From 4d446939a04bdf226b5e1f42216c54209b9ce1f2 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Sat, 2 Apr 2005 20:18:09 +0000 Subject: [PATCH] bitkeeper revision 1.1236.1.200 (424efe01yAPteHQ-fOPSaM_1yE9IfA) Makefile fixes. mbootpack dependencies now work properly. Signed-off-by: Keir Fraser --- Config.mk | 9 +----- tools/misc/mbootpack/Makefile | 52 ++++++++++------------------------- xen/Rules.mk | 6 ---- 3 files changed, 15 insertions(+), 52 deletions(-) diff --git a/Config.mk b/Config.mk index b79ede3952..2db6c644fe 100644 --- a/Config.mk +++ b/Config.mk @@ -10,9 +10,7 @@ override TARGET_SUBARCH := $(XEN_TARGET_ARCH) override COMPILE_ARCH := $(patsubst x86%,x86,$(XEN_COMPILE_ARCH)) override TARGET_ARCH := $(patsubst x86%,x86,$(XEN_TARGET_ARCH)) -# -# Tool configuration Makefile fragment -# +# Tools to run on system hosting the build HOSTCC = gcc HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer @@ -26,7 +24,6 @@ STRIP = $(CROSS_COMPILE)strip OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump - ifneq ($(EXTRA_PREFIX),) EXTRA_INCLUDES += $(EXTRA_PREFIX)/include EXTRA_LIB += $(EXTRA_PREFIX)/lib @@ -34,7 +31,3 @@ endif LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i)) - -CFLAGS += -g - - diff --git a/tools/misc/mbootpack/Makefile b/tools/misc/mbootpack/Makefile index 7cd6a6ad14..69d26dc014 100644 --- a/tools/misc/mbootpack/Makefile +++ b/tools/misc/mbootpack/Makefile @@ -8,56 +8,36 @@ INSTALL_DIR = $(INSTALL) -d -m0755 XEN_ROOT=../../.. include $(XEN_ROOT)/tools/Rules.mk -CFLAGS += -Wall -Werror -O3 - -INCLUDES += -I $(XEN_XC) -INCLUDES += -I $(XEN_LIBXC) -CFLAGS += $(INCLUDES) - -HDRS = $(wildcard *.h) - -TARGETS = mbootpack - -INSTALL_BIN = mbootpack -INSTALL_SBIN = - all: build -build: $(TARGETS) +build: mbootpack install: build - $(INSTALL_PROG) $(INSTALL_BIN) $(DESTDIR)/usr/bin + $(INSTALL_PROG) mbootpack $(DESTDIR)/usr/bin -# -# What object files need building for the program -# - -OBJS := mbootpack.o buildimage.o -DEPS := mbootpack.d buildimage.d - -# # Tools etc. -# - RM := rm -f GDB := gdb INCS := -I. -I- DEFS := LDFLAGS := CC := gcc -CFLAGS := -W -Wall -Wpointer-arith -Wcast-qual -Wno-unused -Wno-format +CFLAGS := -Wall -Wpointer-arith -Wcast-qual -Wno-unused -Wno-format CFLAGS += -Wmissing-prototypes #CFLAGS += -pipe -g -O0 -Wcast-align CFLAGS += -pipe -O3 -# -# Rules -# +# What object files need building for the program +OBJS := mbootpack.o buildimage.o + +# Get gcc to generate the dependencies for us. +DEPFLAGS = -Wp,-MD,.$(@F).d +DEPS = .*.d mbootpack: $(OBJS) $(CC) -o $@ $(filter-out %.a, $^) $(LDFLAGS) -clean: FRC - $(RM) mbootpack *.o *.d bootsect setup bzimage_header.c bin2c +clean: + $(RM) mbootpack *.o $(DEPS) bootsect setup bzimage_header.c bin2c bootsect: bootsect.S $(CC) $(CFLAGS) $(INCS) $(DEFS) -D__MB_ASM -c bootsect.S -o bootsect.o @@ -78,16 +58,12 @@ buildimage.c: bzimage_header.c @ %.o: %.S - $(CC) $(CFLAGS) $(INCS) $(DEFS) -c $< -o $@ + $(CC) $(DEPFLAGS) $(CFLAGS) $(INCS) $(DEFS) -c $< -o $@ %.o: %.c - $(CC) $(CFLAGS) $(INCS) $(DEFS) -c $< -o $@ - -%.d: %.c - $(CC) $(CFLAGS) $(INCS) $(DEFS) -M $< > $@ + $(CC) $(DEPFLAGS) $(CFLAGS) $(INCS) $(DEFS) -c $< -o $@ -FRC: -.PHONY:: all FRC clean gdb +.PHONY: all clean gdb .PRECIOUS: $(OBJS) $(OBJS:.o=.c) $(DEPS) .SUFFIXES: diff --git a/xen/Rules.mk b/xen/Rules.mk index f9650fc744..cf30a12ef7 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -9,12 +9,6 @@ crash_debug ?= n include $(BASEDIR)/../Config.mk -# Set ARCH/SUBARCH appropriately. -override COMPILE_SUBARCH := $(XEN_COMPILE_ARCH) -override TARGET_SUBARCH := $(XEN_TARGET_ARCH) -override COMPILE_ARCH := $(patsubst x86%,x86,$(XEN_COMPILE_ARCH)) -override TARGET_ARCH := $(patsubst x86%,x86,$(XEN_TARGET_ARCH)) - TARGET := $(BASEDIR)/xen HDRS := $(wildcard $(BASEDIR)/include/xen/*.h) HDRS += $(wildcard $(BASEDIR)/include/public/*.h) -- 2.30.2